package com.xls.pet.exception;

import com.xls.pet.common.ResultCode;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public class BusinessException extends RuntimeException {

    private Integer code;

    private String errorMessage;

    public BusinessException(ResultCode resultCode) {
        this.code = resultCode.getCode();
        this.errorMessage = resultCode.getMessage();
    }
}
